home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 8: LINUX Games / Linux Cubed Series 8 - LINUX Games.iso / games / x11 / rpg / crossfir.92 / crossfir / crossfire-0.92.5 / crossedit / Attr.h < prev    next >
C/C++ Source or Header  |  1996-07-24  |  2KB  |  90 lines

  1. #ifndef _Attr_h
  2. #define _Attr_h
  3.  
  4. #include <Defines.h>
  5. #include <Cnv.h>
  6.  
  7.  
  8. /**********************************************************************/
  9.  
  10. /*** variables, index ***/
  11. typedef enum {
  12.     I_Path, I_X, I_Y, I_Weight, I_Connect, I_Hp, 
  13.     I_Trigger, I_Sacrifice, I_Count, I_Lockcode, 
  14.     I_Direction, I_Rotation, I_NoPick, I_Unique, 
  15.     I_WeightL, I_Brand
  16. } AttrIndex;
  17.  
  18. typedef enum _AttrType { 
  19.     TypeString,
  20.     TypeToggle 
  21. } AttrType;
  22.  
  23. typedef void (*AttrFunc)(object *, char *, XtPointer);
  24.  
  25. typedef struct {
  26.     String label;
  27.     AttrType type;
  28.     AttrFunc getValue;
  29.     AttrFunc putValue;
  30. } AttrDef;
  31.  
  32. typedef struct {
  33.     Widget cont;
  34.     Widget value;
  35. } AttrTags;
  36.  
  37. struct _Attr {
  38.     struct _Attr *attr;
  39.     App app;
  40.     Widget w;                /* not used */
  41.     unsigned long flags;     /* editor-type T_<> */
  42.     int attrnumber;
  43.     object *op;              /* object to edit */
  44.     Edit client;
  45.     Widget shell;            /* popup-shell */
  46.     struct {
  47.     Widget name;         /* text */
  48.     Widget msg;          /* command */
  49.     Widget inv;          /* command */
  50.     Widget exact;        /* for dumbing object data */
  51.     Widget face;         /* face of object */
  52.     Widget vars;         /* to get list of variables; command */
  53.     Widget var;          /* variable name of object; text */
  54.     Widget value;        /* value of variable; text */
  55.     } iw;
  56.     struct {
  57.     Widget shell;
  58.     Widget list;
  59.     } vars;
  60.     AttrTags *tags;
  61. #if 1
  62.     AttrDef *desc;
  63. #endif
  64.     Boolean isup;            /* is window popped up  */
  65.     Boolean modified;        /* should not used */
  66.     CnvBrowse dump;          /* showing window for dump_object */  
  67. };
  68.  
  69. /*
  70.  * macro inteface
  71.  */
  72. #define AttrGetObject(self) (self->op)
  73. #define AttrIsup(self)      (self->isup)
  74. #define AttrSetIsup(self,b) {self->isup = b;}
  75.  
  76. /*
  77.  * function inteface
  78.  */
  79. extern Attr AttrCreate ( char *name, App app, object *ob, 
  80.             AttrDef *desc, unsigned long flags, Edit);
  81. extern void AttrChange ( Attr self, object *ob, unsigned long flags, Edit);
  82. extern void AttrDestroy ( Attr self );
  83. extern void AttrApply ( Attr self );
  84.  
  85. extern int GetType (object *tmp);
  86.  
  87. extern AttrDef AttrDescription[];
  88.  
  89. #endif /* _Attr_h */
  90.